home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-MIPS / DS1286.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  70 lines

  1. /* $Id: ds1286.h,v 1.1 1998/07/09 20:01:30 ralf Exp $
  2.  *
  3.  * mc146818rtc.h - register definitions for the Real-Time-Clock / CMOS RAM
  4.  * Copyright Torsten Duwe <duwe@informatik.uni-erlangen.de> 1993
  5.  * derived from Data Sheet, Copyright Motorola 1984 (!).
  6.  * It was written to be part of the Linux operating system.
  7.  */
  8. /* permission is hereby granted to copy, modify and redistribute this code
  9.  * in terms of the GNU Library General Public License, Version 2 or later,
  10.  * at your option.
  11.  */
  12. #ifndef _MC146818RTC_H
  13. #define _MC146818RTC_H
  14.  
  15. #include <asm/mc146818rtc.h>
  16.  
  17. /**********************************************************************
  18.  * register summary
  19.  **********************************************************************/
  20. #define RTC_HUNDREDTH_SECOND    0
  21. #define RTC_SECONDS        1
  22. #define RTC_MINUTES        2
  23. #define RTC_MINUTES_ALARM    3
  24. #define RTC_HOURS        4
  25. #define RTC_HOURS_ALARM        5
  26. #define RTC_DAY            6
  27. #define RTC_DAY_ALARM        7
  28. #define RTC_DATE        8
  29. #define RTC_MONTH        9
  30. #define RTC_YEAR        10
  31. #define RTC_CMD            11
  32. #define RTC_WHSEC        12
  33. #define RTC_WSEC        13
  34. #define RTC_UNUSED        14
  35.  
  36. /* RTC_*_alarm is always true if 2 MSBs are set */
  37. # define RTC_ALARM_DONT_CARE     0xC0
  38.  
  39.  
  40. /*
  41.  * Bits in the month register
  42.  */
  43. #define RTC_EOSC        0x80
  44. #define RTC_ESQW        0x40
  45.  
  46. /*
  47.  * Bits in the Command register
  48.  */
  49. #define RTC_TDF            0x01
  50. #define RTC_WAF            0x02
  51. #define RTC_TDM            0x04
  52. #define RTC_WAM            0x08
  53. #define RTC_PU_LVL        0x10
  54. #define RTC_IBH_LO        0x20
  55. #define RTC_IPSW        0x40
  56. #define RTC_TE            0x80
  57.  
  58. /*
  59.  * Conversion between binary and BCD.
  60.  */
  61. #ifndef BCD_TO_BIN
  62. #define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
  63. #endif
  64.  
  65. #ifndef BIN_TO_BCD
  66. #define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
  67. #endif
  68.  
  69. #endif /* _MC146818RTC_H */
  70.